#include "mainwindow.h"
#include <QDebug>
#include <QPushButton>
#include <QTimer>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
}

MainWindow::~MainWindow()
{
}

void MainWindow::init()
{
    setMinimumWidth(240);
    {
        QPushButton *hasKeyStateLabel = new QPushButton(this);
        hasKeyStateLabel->setText(QStringLiteral("Toggle Show"));
        QObject::connect(hasKeyStateLabel, &QPushButton::clicked, this, &MainWindow::slotToggleShowButton);
    }
}

void MainWindow::slotToggleShowButton()
{
    hide();
    QTimer::singleShot(1000, this, [this]() {
        qWarning() << "[=== checkmode ===]"
                   << "show";
        show();
    });
}
